#include "ShareMemory.hpp"
#include"Time.hpp"
#include <iostream>
using namespace std;

int main()
{
    //cout<<GetCurrTime()<<endl;
    ShareMemory s;
    s.CreateShm();
    cout<<"shamid "<<endl;
    sleep(5);
    s.AttachShm();
    sleep(5);
    //在这里IPC
    struct Image* img=(Image*)s.GetAddr();
    while (true)
    {
        printf("status: %s\n",img->status);
        printf("lasttime: %s\n",img->lasttime);
        printf("image: %s\n",img->image);

    }
    
    
    //printf("虚拟地址是：%p\n",strinfo);

    s.DttachShm();
    sleep(5);

    s.DelentShm();
    return 0;
}